(defun not (sexp)
  (if sexp false true))

(defun > (a b)
  (< b a))

(defun <= (a b)
  (if (< a b)
      true
    (eq a b)))

(defun >= (a b)
  (if (> a b)
      true
    (eq a b)))

(defun dolist (l fn)
  (let ((it (iterator l)))
    (while (has-next it)
      (apply fn (next it) $rest))))

(defun dotimes (n fn)
  (let ((i 0))
    (while (< i n)
      (apply fn i $rest)
      (setq i (+ i 1)))))

(defun map (l fn)
  (let ((ret ()))
    (dolist l
      (lambda (i)
	(append ret (apply fn i $rest))))
    ret))

(defun tak (x y z)
  (if (<= x y) y
    (tak (tak (- x 1) y z)
	 (tak (- y 1) z x)
	 (tak (- z 1) x y))))

(defun fib (n)
  (if (eq n 0)
      1
    (if (eq n 1)
	1
      (+ (fib (- n 1))
	 (fib (- n 2))))))
